package 二叉树;


/**
 * https://leetcode.cn/problems/invert-binary-tree/description/?envType=study-plan-v2&envId=top-100-liked
 *
 * 題解：https://mp.weixin.qq.com/s?__biz=MzAxODQxMDM0Mw==&mid=2247493390&idx=1&sn=468d99bfcf2e69cfa36c6456c4f7e744&chksm=9bd41906aca39010c8457f6df9aef2b54cd8c5f4950c25a1248babbcdda3b374ab2af2b878be&scene=178&cur_album_id=2165089327943417857#rd
 */
public class _226_翻转二叉树 {

    public TreeNode invertTree(TreeNode root) {
        if (root == null) return root;
        TreeNode left = invertTree(root.left);
        TreeNode rigth = invertTree(root.right);

        root.left = rigth;
        root.right = left;

        return root;
    }
}
